# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-cdsapi
_pkgorig=cdsapi
pkgver=0.5.1
pkgrel=0
pkgdesc="Python API to access the Copernicus Climate Data Store"
url="https://github.com/ecmwf/cdsapi"
arch="noarch"
license="Apache-2.0 license"
depends="python3 py3-requests py3-tqdm"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-runner"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/c/cdsapi/cdsapi-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # we need API key for test

build() {
	python3 setup.py build
}

check() {
	python3 -m pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
5f1c12c39e1f5162ff6f8bf1dd170817adc37c66935395d46ca1914a312474502a35e759a04b83997f92999c76336f5141a7f16c7a137aa3831c1d5c78578809  py3-cdsapi-0.5.1.tar.gz
"
